package com.wicket.okrpbff.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrpbff.biz.service.SecurityService;
import com.wicket.okrpbff.biz.service.dto.req.*;
import com.wicket.okrpbff.biz.service.dto.res.*;
import com.wicket.okrpbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBaseSecurityClient;
import com.wicket.okrframework.integration.dto.ArchiveSoftwareAuthorizationRespDto;
import com.wicket.okrframework.integration.dto.ArchiveSoftwareAuthorizationReqDto;
import com.wicket.okrpbff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.QuerySoftwareAuthorizationListRespDto;
import com.wicket.okrframework.integration.dto.QuerySoftwareAuthorizationListReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordComRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordComReqDto;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrframework.integration.dto.QuerySoftwareAuthorizationDetailRespDto;
import com.wicket.okrframework.integration.dto.QuerySoftwareAuthorizationDetailReqDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComReqDto;
import com.wicket.okrframework.integration.dto.UpdateSoftwareAuthorizationRespDto;
import com.wicket.okrframework.integration.dto.UpdateSoftwareAuthorizationReqDto;
import com.wicket.okrframework.integration.dto.DeleteSoftwareAuthorizationRespDto;
import com.wicket.okrframework.integration.dto.DeleteSoftwareAuthorizationReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffSoftwareAuthorizationDto;
import com.wicket.okrcomponent.integration.FwCompSecurityClient;
import com.wicket.okrcomponent.integration.dto.QuerySecurityLicenseDetailRespDto;
import com.wicket.okrcomponent.integration.dto.QuerySecurityLicenseDetailReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "Security", tags = { "Security" })
@RestController
// @RequestMapping("/poms/security/")
public class SecurityController {

  @Autowired
  SecurityService securityService;
/**
   * B1存档软件授权证书(管理)
   * gen by moon at 5/12/2023, 3:06:39 AM
   */
    @PostMapping("/oms/platform/mgt/security/archiveSoftwareAuthorization")
    @ApiOperation(value = "B1存档软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffArchiveSoftwareAuthorizationRespDto> archiveSoftwareAuthorization(@RequestBody(required=false) @Validated BffArchiveSoftwareAuthorizationReqDto reqDTO){
        return OkrResult.success(securityService.archiveSoftwareAuthorization(reqDTO));
    }
/**
   * B1查询软件授权证书列表(管理)
   * gen by moon at 5/12/2023, 3:15:55 AM
   */
    @PostMapping("/oms/platform/mgt/security/querySoftwareAuthorizationList")
    @ApiOperation(value = "B1查询软件授权证书列表(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySoftwareAuthorizationListRespDto> querySoftwareAuthorizationList(@RequestBody(required=false) @Validated BffQuerySoftwareAuthorizationListReqDto reqDTO){
        return OkrResult.success(securityService.querySoftwareAuthorizationList(reqDTO));
    }
/**
   * B1查询软件授权证书详情(管理)
   * gen by moon at 5/12/2023, 3:15:57 AM
   */
    @PostMapping("/oms/platform/mgt/security/querySoftwareAuthorizationDetail")
    @ApiOperation(value = "B1查询软件授权证书详情(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySoftwareAuthorizationDetailRespDto> querySoftwareAuthorizationDetail(@RequestBody(required=false) @Validated BffQuerySoftwareAuthorizationDetailReqDto reqDTO){
        return OkrResult.success(securityService.querySoftwareAuthorizationDetail(reqDTO));
    }
/**
   * B1修改软件授权证书(管理)
   * gen by moon at 5/12/2023, 3:15:59 AM
   */
    @PostMapping("/oms/platform/mgt/security/updateSoftwareAuthorization")
    @ApiOperation(value = "B1修改软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffUpdateSoftwareAuthorizationRespDto> updateSoftwareAuthorization(@RequestBody(required=false) @Validated BffUpdateSoftwareAuthorizationReqDto reqDTO){
        return OkrResult.success(securityService.updateSoftwareAuthorization(reqDTO));
    }
/**
   * B1删除软件授权证书(管理)
   * gen by moon at 5/12/2023, 3:16:02 AM
   */
    @PostMapping("/oms/platform/mgt/security/deleteSoftwareAuthorization")
    @ApiOperation(value = "B1删除软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffDeleteSoftwareAuthorizationRespDto> deleteSoftwareAuthorization(@RequestBody(required=false) @Validated BffDeleteSoftwareAuthorizationReqDto reqDTO){
        return OkrResult.success(securityService.deleteSoftwareAuthorization(reqDTO));
    }
/**
   * B1查询安全License详情(管理)
   * gen by moon at 5/14/2023, 10:25:58 PM
   */
    @PostMapping("/oms/platform/mgt/security/querySecurityLicenseDetail")
    @ApiOperation(value = "B1查询安全License详情(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySecurityLicenseDetailRespDto> querySecurityLicenseDetail(@RequestBody(required=false) @Validated BffQuerySecurityLicenseDetailReqDto reqDTO){
        return OkrResult.success(securityService.querySecurityLicenseDetail(reqDTO));
    }
}
